package com.yoda.mall.admin.controller;

import com.yoda.mall.admin.service.CouponHistoryService;
import com.yoda.mall.model.entity.sms.CouponHistory;
import com.yoda.mall.model.vo.PageResult;
import com.yoda.mall.model.vo.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("couponHistory")
public class CouponHistoryController {
    @Autowired
    private CouponHistoryService couponHistoryService;
    //根据优惠券id，使用状态，订单编号分页获取领取记录
    @GetMapping("list")
    public R couponHistoryListPage(Long couponId,String orderSn,Integer pageNum,Integer pageSize,Integer useStatus){
       PageResult<CouponHistory> pageResult = couponHistoryService.couponHistoryListPage(couponId,orderSn,pageNum,pageSize,useStatus);
       return R.success(pageResult);
    }
}
